<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>考试安排编辑</title>
</head>

<body>
<style>
	.line{
		margin:5px 20px;
	}
	.div{
		float:left;
		margin:0px 50px 0px 10px;
		font-size:13px;
	}
	.line .line1{
		margin-left:130px;
	}
</style>
<script type="text/javascript">
	$(function(){
		//返回
		$(".back_ksap_update").linkbutton({
			onClick:function(){
				$(".back_ksap_update_").panel({
					href:"to_ksap"
					
				})
			}
		})
		
		//表格点击事件
		$('#epId').textbox({
			icons: [{
				iconCls:'icon-add',
				handler: function(e){
					$("#hhy_examPaper_dialog").dialog("open");
					$("#hhy_examPaper_findAll").datagrid({onDblClickRow:function(index,row){
						var kssj_epId = row.epId;
						var kssj_epName= row.classSjName;
						$('#epId').textbox('setValue',kssj_epId);
						$('#classSjName').textbox('setValue',kssj_epName);
						
						$('#hhy_examPaper_dialog').dialog('close');

					}});
				}
			}]
		})
		
		//添加
		$("#hhy_ksap_insert_add").linkbutton({onClick:function(){
			/* || $('#epStarttime').val()=='' || $('#epEndtime').val()==''|| $('#epShichang').textbox("getText")=='' */
			if ($('#epId').textbox("getText")=='' || $('#classSjName').textbox("getText")=='' ) {
				$.messager.confirm('提示','带*的为必填项',function(r){    
				}); 
			}else{
			$("#ksap_insert_form").form({
				url:'ksap_update_sava',
				onSubmit:function(insert){
					insert["arrangeName"] = $("#arrangeName").textbox("getText");
					insert["arrangeId"] = $("#arrangeId").textbox("getText");
					insert["arrangQualified"] = $("#arrangQualified").textbox("getText");
					insert["arrangeRemark"] = $("#arrangeRemark").val();
					insert["arrangeAddress"] = $("#arrangeAddress").val();
					
					insert["arrangeUnifyEspecial"] = $("#arrangeUnifyEspecial").val();
					insert["arrangeLookAnswer"] = $("#arrangeLookAnswer").val();
					insert["arrangeStart"] = $("#arrangeStart").val();
					insert["arrangeNumberExaminee"] = $("#arrangeNumberExaminee").textbox("getText");
					insert["arrangeNumberAdministrator"] = $("#arrangeNumberAdministrator").textbox("getText");
				
					insert["classSjName"] = $("#classSjName").textbox("getText");
					
					
				},
				success:function(v){
					v = eval("("+v+")");
					if(v.success){
						$.messager.alert('恭喜', '添加成功');
						$(".back_ksap_update_").panel({
							href:"to_ksap"
							
						})
					}else{
						$.messager.alert('错误', '对不起，操作失败，原因：'+v.message);
					}
				}
			}).submit();
			}
		}});
		
	});		
</script>
<div class="easyui-panel back_ksap_update_" data-options="fit:true,border:false">
	<a href="#" class="easyui-linkbutton back_ksap_update"  data-options="iconCls:'icon-back',plain:true,text:'返回'"></a>
	<!-- <a href="#" class="easyui-linkbutton"  data-options="iconCls:'icon-filesave',plain:true,text:'保存'"></a> -->
	<form id="ksap_insert_form" method="post"></form>
		<div class="div">
			<div style="border-bottom:2px solid blue;width:400px;">考试安排</div>
			<div class="line">
					<input class="easyui-textbox" id="arrangeId" name="arrangeId" data-options="label:'考试安排编号',width:350,height:25,labelWidth:130" value="${ksap_update.arrangeId}"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" id="arrangeName" name="arrangeName" data-options="label:'考试安排名称',width:350,height:25,labelWidth:130" value="${ksap_update.arrangeName}"/>
				</div>
				<div class="line">
					<input class="easyui-textbox"  name="epId" id="epId" data-options="label:'*试卷编号',width:350,height:25,labelWidth:130,editable:false" value="${ksap_update.epId}"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" id="classSjName" name="classSjName"  data-options="label:'*试卷名称',width:350,height:25,labelWidth:130,editable:false,readonly:true" value="${ksap_update.classSjName}"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" id="epTotal" name="epTotal" data-options="label:'总分/合格线',width:235,height:25,labelWidth:130,readonly:true" value="${ksap_update.epTotal}"/>
					<input class="easyui-textbox" id="arrangQualified" name="arrangQualified" data-options="width:110,height:25" value="${ksap_update.arrangQualified}"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" id="arrangeNumberExaminee" name="arrangeNumberExaminee" data-options="label:'考生数/管理员数',width:235,height:25,labelWidth:130" value="${ksap_update.arrangeNumberExaminee}"/>
					<input class="easyui-textbox" id="arrangeNumberAdministrator" name="arrangeNumberAdministrator" data-options="width:110,height:25" value="${ksap_update.arrangeNumberAdministrator}"/>
				</div>
				<div class="line">
					<select name="epWay" id="epWay" class="easyui-combobox" data-options="label:'考试方式/等级',width:235,height:25,panelHeight:'auto',labelWidth:130,editable:false,readonly:true" value="${ksap_update.epWay}">
					<option value="未开考">面试</option>
					<option value="笔试">笔试</option>
					<option value="机试">机试</option>
					</select>
					<select name="epGrade" id="epGrade" class="easyui-combobox" data-options="width:110,height:25,panelHeight:'auto',labelWidth:130,editable:false,readonly:true">
					<option value="高级">高级</option>
					<option value="中级">中级</option>
					<option value="低级">低级</option>
					</select>
				</div>
			</div>
			<div class="div">
				<div style="border-bottom:2px solid blue;width:400px;">概要</div>
				<div class="line">
					<input class="easyui-textbox" id="epStarttime" name="epStarttime" data-options="label:'开始时间',width:350,labelWidth:130,height:25,readonly:true" value="${ksap_update.epStarttime}"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" id="epEndtime" name="epEndtime" data-options="label:'结束时间',width:350,labelWidth:130,height:25,readonly:true" value="${ksap_update.epEndtime}"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" id="epShichang" name="epShichang" data-options="label:'时长',width:350,height:25,labelWidth:130,readonly:true" value="${ksap_update.epShichang}"/>
				</div>
				<div class="line">
					<select name="arrangeUnifyEspecial" id="arrangeUnifyEspecial" class="easyui-combobox" data-options="label:'统一开考/查看答案',width:235,height:25,panelHeight:'auto',labelWidth:130,editable:false" value="${ksap_update.epWay}">
					<option value="是">是</option>
					<option value="否">否</option>
					</select>
					<select name="arrangeLookAnswer" id="arrangeLookAnswer" class="easyui-combobox" data-options="width:110,height:25,panelHeight:'auto',labelWidth:130,editable:false">
					<option value="是">是</option>
					<option value="否">否</option>
					</select>
				</div>
				<div class="line">
					<select name="arrangeStart" id="arrangeStart" class="easyui-combobox" data-options="label:'考场状态',width:350,height:25,panelHeight:'auto',labelWidth:130,editable:false">
					<option value="未开放">未开放</option>
					<option value="开放中">开放中</option>
					<option value="已封闭">已封闭</option>
					<option value="已关闭">已关闭</option>
					</select>
				</div>
				
			</div>
			<div class="div">
			<div style="border-bottom:2px solid blue;width:850px;margin-bottom:5px;">地址</div>
				<div>
					<textarea id="arrangeAddress" name="arrangeAddress" rows="5" cols="118">${ksap_update.arrangeAddress}</textarea>
				</div>
			</div>
			
			<div class="div">
			<div style="border-bottom:2px solid blue;width:850px;margin-bottom:5px;">备注</div>
				<div >
					<textarea id="arrangeRemark" name="arrangeRemark" rows="5" cols="118">${ksap_update.arrangeRemark}</textarea>
				</div></br>
				
				<div>
					<a id="hhy_ksap_insert_add" class="easyui-linkbutton" data-options="width:80,height:30,text:'添加'"></a>
				</div>
			</div>
			
			<div class="easyui-dialog" id="hhy_examPaper_dialog" data-options="width:550,height:400,title:'清单查找-试卷',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						$('#f_ksap').form({
							onSubmit:function(){
								var row = $('#hhy_examPaper_findAll').datagrid('getSelected');
							
								$('#ksap_insert_form').form('load','dkka?id='+row.epId);
							},success:function(v){
								$('#hhy_examPaper_dialog').dialog('close');
							}
						}).submit();
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#hhy_examPaper_dialog').dialog('close');
					}
				}]">
				<form action="" method="post" id="f_ksap">
					<div class="line">
						<input class="easyui-textbox" id="epId" data-options="label:'试卷编号',width:300,height:25"/>
						<a class="easyui-linkbutton" name="vague" data-options="text:'模糊查询',width:100,height:25" style="float:right"/>
						
					</div>
					<div class="line">
						<input class="easyui-textbox" name="classSjName" data-options="label:'试卷名称',width:300,height:25"/>
						<a class="easyui-linkbutton" name="vague" data-options="text:'搜索',width:100,height:25" style="float:right"/>
					</div>
					
					<div class="line">
						<table id="hhy_examPaper_findAll" style="width:100%;" class="easyui-datagrid" data-options="
							pagination:true,
							url:'findAll_examPaper_page',
							method:'get',
							pageSize:10,
							pageList:[5,10,15,20,25],
							autoRowHeight:true,
							nowrap:false,
							autoRowHeight:true,
							rownumbers:true,
							singleSelect:true,
							striped:true">
							<thead>
							  <tr>
								<th data-options="width:120,align:'center',field:'epId'">试卷编号</th>
								<th data-options="width:150,align:'center',field:'classSjName'">试卷名称</th>
							  </tr>
							</thead>
							<tbody>
							
							</tbody>
						</table>
					</div>
				</form>
			</div>
</div>
</body>
</html>